3.1.33 \(\int \frac {1+2 x}{(3+x+x^2) \sqrt {5+x+x^2}} \, dx\) [33]

Optimal. Leaf size=24 \[ -\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {5+x+x^2}}{\sqrt {2}}\right ) \]

[Out]

-arctanh(1/2*(x^2+x+5)^(1/2)*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {1038, 212} \begin {gather*} -\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {x^2+x+5}}{\sqrt {2}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + 2*x)/((3 + x + x^2)*Sqrt[5 + x + x^2]),x]

[Out]

-(Sqrt[2]*ArcTanh[Sqrt[5 + x + x^2]/Sqrt[2]])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 1038

Int[((g_) + (h_.)*(x_))/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol
] :> Dist[-2*g, Subst[Int[1/(b*d - a*e - b*x^2), x], x, Sqrt[d + e*x + f*x^2]], x] /; FreeQ[{a, b, c, d, e, f,
 g, h}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[e^2 - 4*d*f, 0] && EqQ[c*e - b*f, 0] && EqQ[h*e - 2*g*f, 0]

Rubi steps

\begin {align*} \int \frac {1+2 x}{\left (3+x+x^2\right ) \sqrt {5+x+x^2}} \, dx &=-\left (2 \text {Subst}\left (\int \frac {1}{2-x^2} \, dx,x,\sqrt {5+x+x^2}\right )\right )\\ &=-\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {5+x+x^2}}{\sqrt {2}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.20, size = 24, normalized size = 1.00 \begin {gather*} -\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {5+x+x^2}}{\sqrt {2}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + 2*x)/((3 + x + x^2)*Sqrt[5 + x + x^2]),x]

[Out]

-(Sqrt[2]*ArcTanh[Sqrt[5 + x + x^2]/Sqrt[2]])

________________________________________________________________________________________

Maple [A]
time = 0.32, size = 20, normalized size = 0.83

method result size
default \(-\arctanh \left (\frac {\sqrt {x^{2}+x +5}\, \sqrt {2}}{2}\right ) \sqrt {2}\) \(20\)
trager \(\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) \ln \left (\frac {-\RootOf \left (\textit {\_Z}^{2}-2\right ) x^{2}-\RootOf \left (\textit {\_Z}^{2}-2\right ) x +4 \sqrt {x^{2}+x +5}-7 \RootOf \left (\textit {\_Z}^{2}-2\right )}{x^{2}+x +3}\right )}{2}\) \(58\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x+1)/(x^2+x+3)/(x^2+x+5)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-arctanh(1/2*(x^2+x+5)^(1/2)*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+2*x)/(x^2+x+3)/(x^2+x+5)^(1/2),x, algorithm="maxima")

[Out]

integrate((2*x + 1)/(sqrt(x^2 + x + 5)*(x^2 + x + 3)), x)

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 34, normalized size = 1.42 \begin {gather*} \frac {1}{2} \, \sqrt {2} \log \left (\frac {x^{2} - 2 \, \sqrt {2} \sqrt {x^{2} + x + 5} + x + 7}{x^{2} + x + 3}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+2*x)/(x^2+x+3)/(x^2+x+5)^(1/2),x, algorithm="fricas")

[Out]

1/2*sqrt(2)*log((x^2 - 2*sqrt(2)*sqrt(x^2 + x + 5) + x + 7)/(x^2 + x + 3))

________________________________________________________________________________________

Sympy [A]
time = 2.13, size = 68, normalized size = 2.83 \begin {gather*} 2 \left (\begin {cases} - \frac {\sqrt {2} \operatorname {acoth}{\left (\frac {\sqrt {2}}{\sqrt {x^{2} + x + 5}} \right )}}{2} & \text {for}\: \frac {1}{x^{2} + x + 5} > \frac {1}{2} \\- \frac {\sqrt {2} \operatorname {atanh}{\left (\frac {\sqrt {2}}{\sqrt {x^{2} + x + 5}} \right )}}{2} & \text {for}\: \frac {1}{x^{2} + x + 5} < \frac {1}{2} \end {cases}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+2*x)/(x**2+x+3)/(x**2+x+5)**(1/2),x)

[Out]

2*Piecewise((-sqrt(2)*acoth(sqrt(2)/sqrt(x**2 + x + 5))/2, 1/(x**2 + x + 5) > 1/2), (-sqrt(2)*atanh(sqrt(2)/sq
rt(x**2 + x + 5))/2, 1/(x**2 + x + 5) < 1/2))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (19) = 38\).
time = 4.46, size = 39, normalized size = 1.62 \begin {gather*} -\frac {1}{2} \, \sqrt {2} \log \left (\sqrt {2} + \sqrt {x^{2} + x + 5}\right ) + \frac {1}{2} \, \sqrt {2} \log \left (-\sqrt {2} + \sqrt {x^{2} + x + 5}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+2*x)/(x^2+x+3)/(x^2+x+5)^(1/2),x, algorithm="giac")

[Out]

-1/2*sqrt(2)*log(sqrt(2) + sqrt(x^2 + x + 5)) + 1/2*sqrt(2)*log(-sqrt(2) + sqrt(x^2 + x + 5))

________________________________________________________________________________________

Mupad [B]
time = 3.78, size = 19, normalized size = 0.79 \begin {gather*} -\sqrt {2}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {x^2+x+5}}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x + 1)/((x + x^2 + 3)*(x + x^2 + 5)^(1/2)),x)

[Out]

-2^(1/2)*atanh((2^(1/2)*(x + x^2 + 5)^(1/2))/2)

________________________________________________________________________________________